var md5$1 = {
    exports: {}
}, crypt = {
    exports: {}
}, base64map, crypt$1;
base64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
    crypt$1 = {
        rotl: function (e, t) {
            return e << t | e >>> 32 - t
        },
        rotr: function (e, t) {
            return e << 32 - t | e >>> t
        },
        endian: function (e) {
            if (e.constructor == Number)
                return 16711935 & crypt$1.rotl(e, 8) | 4278255360 & crypt$1.rotl(e, 24);
            for (var t = 0; t < e.length; t++)
                e[t] = crypt$1.endian(e[t]);
            return e
        },
        randomBytes: function (e) {
            for (var t = []; e > 0; e--)
                t.push(Math.floor(256 * Math.random()));
            return t
        },
        bytesToWords: function (e) {
            for (var t = [], r = 0, n = 0; r < e.length; r++,
                n += 8)
                t[n >>> 5] |= e[r] << 24 - n % 32;
            return t
        },
        wordsToBytes: function (e) {
            for (var t = [], r = 0; r < 32 * e.length; r += 8)
                t.push(e[r >>> 5] >>> 24 - r % 32 & 255);
            return t
        },
        bytesToHex: function (e) {
            for (var t = [], r = 0; r < e.length; r++)
                t.push((e[r] >>> 4).toString(16)),
                    t.push((15 & e[r]).toString(16));
            return t.join("")
        },
        hexToBytes: function (e) {
            for (var t = [], r = 0; r < e.length; r += 2)
                t.push(parseInt(e.substr(r, 2), 16));
            return t
        },
        bytesToBase64: function (e) {
            for (var t = [], r = 0; r < e.length; r += 3)
                for (var n = e[r] << 16 | e[r + 1] << 8 | e[r + 2], i = 0; i < 4; i++)
                    8 * r + 6 * i <= 8 * e.length ? t.push(base64map.charAt(n >>> 6 * (3 - i) & 63)) : t.push("=");
            return t.join("")
        },
        base64ToBytes: function (e) {
            e = e.replace(/[^A-Z0-9+\/]/gi, "");
            for (var t = [], r = 0, n = 0; r < e.length; n = ++r % 4)
                0 != n && t.push((base64map.indexOf(e.charAt(r - 1)) & Math.pow(2, -2 * n + 8) - 1) << 2 * n | base64map.indexOf(e.charAt(r)) >>> 6 - 2 * n);
            return t
        }
    },
    crypt.exports = crypt$1;
var cryptExports = crypt.exports, charenc = {
    utf8: {
        stringToBytes: function (e) {
            return charenc.bin.stringToBytes(unescape(encodeURIComponent(e)))
        },
        bytesToString: function (e) {
            return decodeURIComponent(escape(charenc.bin.bytesToString(e)))
        }
    },
    bin: {
        stringToBytes: function (e) {
            for (var t = [], r = 0; r < e.length; r++)
                t.push(255 & e.charCodeAt(r));
            return t
        },
        bytesToString: function (e) {
            for (var t = [], r = 0; r < e.length; r++)
                t.push(String.fromCharCode(e[r]));
            return t.join("")
        }
    }
}, charenc_1 = charenc, isBuffer_1 = function (e) {
    return null != e && (isBuffer(e) || isSlowBuffer(e) || !!e._isBuffer)
}, crypt2, utf8, isBuffer2, bin, md52;
function isBuffer(e) {
    return !!e.constructor && "function" == typeof e.constructor.isBuffer && e.constructor.isBuffer(e)
}
function isSlowBuffer(e) {
    return "function" == typeof e.readFloatLE && "function" == typeof e.slice && isBuffer(e.slice(0, 0))
}
crypt2 = cryptExports,
    utf8 = charenc_1.utf8,
    isBuffer2 = isBuffer_1,
    bin = charenc_1.bin,
    md52 = function e(t, r) {
        t.constructor == String ? t = r && "binary" === r.encoding ? bin.stringToBytes(t) : utf8.stringToBytes(t) : isBuffer2(t) ? t = Array.prototype.slice.call(t, 0) : Array.isArray(t) || t.constructor === Uint8Array || (t = t.toString());
        for (var n = crypt2.bytesToWords(t), i = 8 * t.length, o = 1732584193, a = -271733879, s = -1732584194, l = 271733878, c = 0; c < n.length; c++)
            n[c] = 16711935 & (n[c] << 8 | n[c] >>> 24) | 4278255360 & (n[c] << 24 | n[c] >>> 8);
        n[i >>> 5] |= 128 << i % 32,
            n[14 + (i + 64 >>> 9 << 4)] = i;
        var u = e._ff
            , d = e._gg
            , p = e._hh
            , h = e._ii;
        for (c = 0; c < n.length; c += 16) {
            var f = o
                , m = a
                , v = s
                , g = l;
            o = u(o, a, s, l, n[c + 0], 7, -680876936),
                l = u(l, o, a, s, n[c + 1], 12, -389564586),
                s = u(s, l, o, a, n[c + 2], 17, 606105819),
                a = u(a, s, l, o, n[c + 3], 22, -1044525330),
                o = u(o, a, s, l, n[c + 4], 7, -176418897),
                l = u(l, o, a, s, n[c + 5], 12, 1200080426),
                s = u(s, l, o, a, n[c + 6], 17, -1473231341),
                a = u(a, s, l, o, n[c + 7], 22, -45705983),
                o = u(o, a, s, l, n[c + 8], 7, 1770035416),
                l = u(l, o, a, s, n[c + 9], 12, -1958414417),
                s = u(s, l, o, a, n[c + 10], 17, -42063),
                a = u(a, s, l, o, n[c + 11], 22, -1990404162),
                o = u(o, a, s, l, n[c + 12], 7, 1804603682),
                l = u(l, o, a, s, n[c + 13], 12, -40341101),
                s = u(s, l, o, a, n[c + 14], 17, -1502002290),
                o = d(o, a = u(a, s, l, o, n[c + 15], 22, 1236535329), s, l, n[c + 1], 5, -165796510),
                l = d(l, o, a, s, n[c + 6], 9, -1069501632),
                s = d(s, l, o, a, n[c + 11], 14, 643717713),
                a = d(a, s, l, o, n[c + 0], 20, -373897302),
                o = d(o, a, s, l, n[c + 5], 5, -701558691),
                l = d(l, o, a, s, n[c + 10], 9, 38016083),
                s = d(s, l, o, a, n[c + 15], 14, -660478335),
                a = d(a, s, l, o, n[c + 4], 20, -405537848),
                o = d(o, a, s, l, n[c + 9], 5, 568446438),
                l = d(l, o, a, s, n[c + 14], 9, -1019803690),
                s = d(s, l, o, a, n[c + 3], 14, -187363961),
                a = d(a, s, l, o, n[c + 8], 20, 1163531501),
                o = d(o, a, s, l, n[c + 13], 5, -1444681467),
                l = d(l, o, a, s, n[c + 2], 9, -51403784),
                s = d(s, l, o, a, n[c + 7], 14, 1735328473),
                o = p(o, a = d(a, s, l, o, n[c + 12], 20, -1926607734), s, l, n[c + 5], 4, -378558),
                l = p(l, o, a, s, n[c + 8], 11, -2022574463),
                s = p(s, l, o, a, n[c + 11], 16, 1839030562),
                a = p(a, s, l, o, n[c + 14], 23, -35309556),
                o = p(o, a, s, l, n[c + 1], 4, -1530992060),
                l = p(l, o, a, s, n[c + 4], 11, 1272893353),
                s = p(s, l, o, a, n[c + 7], 16, -155497632),
                a = p(a, s, l, o, n[c + 10], 23, -1094730640),
                o = p(o, a, s, l, n[c + 13], 4, 681279174),
                l = p(l, o, a, s, n[c + 0], 11, -358537222),
                s = p(s, l, o, a, n[c + 3], 16, -722521979),
                a = p(a, s, l, o, n[c + 6], 23, 76029189),
                o = p(o, a, s, l, n[c + 9], 4, -640364487),
                l = p(l, o, a, s, n[c + 12], 11, -421815835),
                s = p(s, l, o, a, n[c + 15], 16, 530742520),
                o = h(o, a = p(a, s, l, o, n[c + 2], 23, -995338651), s, l, n[c + 0], 6, -198630844),
                l = h(l, o, a, s, n[c + 7], 10, 1126891415),
                s = h(s, l, o, a, n[c + 14], 15, -1416354905),
                a = h(a, s, l, o, n[c + 5], 21, -57434055),
                o = h(o, a, s, l, n[c + 12], 6, 1700485571),
                l = h(l, o, a, s, n[c + 3], 10, -1894986606),
                s = h(s, l, o, a, n[c + 10], 15, -1051523),
                a = h(a, s, l, o, n[c + 1], 21, -2054922799),
                o = h(o, a, s, l, n[c + 8], 6, 1873313359),
                l = h(l, o, a, s, n[c + 15], 10, -30611744),
                s = h(s, l, o, a, n[c + 6], 15, -1560198380),
                a = h(a, s, l, o, n[c + 13], 21, 1309151649),
                o = h(o, a, s, l, n[c + 4], 6, -145523070),
                l = h(l, o, a, s, n[c + 11], 10, -1120210379),
                s = h(s, l, o, a, n[c + 2], 15, 718787259),
                a = h(a, s, l, o, n[c + 9], 21, -343485551),
                o = o + f >>> 0,
                a = a + m >>> 0,
                s = s + v >>> 0,
                l = l + g >>> 0
        }
        return crypt2.endian([o, a, s, l])
    }
    ,
    md52._ff = function (e, t, r, n, i, o, a) {
        var s = e + (t & r | ~t & n) + (i >>> 0) + a;
        return (s << o | s >>> 32 - o) + t
    }
    ,
    md52._gg = function (e, t, r, n, i, o, a) {
        var s = e + (t & n | r & ~n) + (i >>> 0) + a;
        return (s << o | s >>> 32 - o) + t
    }
    ,
    md52._hh = function (e, t, r, n, i, o, a) {
        var s = e + (t ^ r ^ n) + (i >>> 0) + a;
        return (s << o | s >>> 32 - o) + t
    }
    ,
    md52._ii = function (e, t, r, n, i, o, a) {
        var s = e + (r ^ (t | ~n)) + (i >>> 0) + a;
        return (s << o | s >>> 32 - o) + t
    }
    ,
    md52._blocksize = 16,
    md52._digestsize = 16,
    md5$1.exports = function (e, t) {
        if (null == e)
            throw new Error("Illegal argument " + e);
        var r = crypt2.wordsToBytes(md52(e, t));
        return t && t.asBytes ? r : t && t.asString ? bin.bytesToString(r) : crypt2.bytesToHex(r)
    }
    ;
var md5Exports = md5$1.exports
    , md5 = getDefaultExportFromCjs(md5Exports)
    , formatString$1 = function (e) {
        for (var t = "", r = 0; r < e.length; r++)
            t += String.fromCharCode(e.charCodeAt(r) - 1);
        return t
    }
    , LOCAL_STORAGE_KEY$1 = "wbi_img_urls";

function getPictureHashKey(e) {
    var t = [];
    return [46, 47, 18, 2, 53, 8, 23, 32, 15, 50, 10, 31, 58, 3, 45, 35, 27, 43, 5, 49, 33, 9, 42, 19, 29, 28, 14, 39, 12, 38, 41, 13, 37, 48, 7, 16, 24, 55, 40, 61, 26, 17, 0, 1, 60, 51, 30, 4, 22, 25, 54, 21, 56, 59, 6, 63, 57, 62, 11, 36, 20, 34, 44, 52].forEach((function (r) {
        e.charAt(r) && t.push(e.charAt(r))
    }
    )),
        t.join("").slice(0, 32)
}

function getDefaultExportFromCjs(e) {
    return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e
}

function getLocal(e) {
    try {
        return localStorage.getItem(e)
    } catch (e2) {
        return null
    }
}

function getImgFormatConfig(e) {
    var t;
    if (e.useAssignKey)
        return {
            imgKey: e.wbiImgKey,
            subKey: e.wbiSubKey
        };
    var r = (null === (t = getLocal(LOCAL_STORAGE_KEY$1)) || void 0 === t ? void 0 : t.split("-")) || []
        , n = r[0]
        , i = r[1];
    return {
        imgKey: n ? getKeyFromURL(n) : e.wbiImgKey,
        subKey: i ? getKeyFromURL(i) : e.wbiSubKey
    }
}

function formatImgByLocalParams(e, t) {
    t || (t = {});
    var r = getImgFormatConfig(t)
        , n = r.imgKey
        , i = r.subKey;
    if (n && i) {
        for (var o = getPictureHashKey(n + i), a = Math.round(Date.now() / 1e3), s = Object.assign({}, e, {
            wts: a
        }), l = Object.keys(s).sort(), c = [], u = /[!'()*]/g, d = 0; d < l.length; d++) {
            var p = l[d]
                , h = s[p];
            h && "string" == typeof h && (h = h.replace(u, "")),
                null != h && c.push("".concat(encodeURIComponent(p), "=").concat(encodeURIComponent(h)))
        }
        var f = c.join("&");
        return {
            w_rid: md5(f + o),
            wts: a.toString()
        }
    }
    return null
}



// t = {
//     "wbiImgKey": "c458435a75b1419ca98ab6d88b4c60d4",
//     "wbiSubKey": "446140f6859f439e9dd83f7ef858d1cd"
// }

// LOCAL_STORAGE_KEY$1 = 'wbi_img_urls'

// f_list = formatImgByLocalParams(e, t);
// console.log(f_list);

function Getw_rids(t) {
    e = {
        "web_location": "333.788"
    }
    var w_rid_list = formatImgByLocalParams(e, t);
    console.log(w_rid_list);
    return w_rid_list;
}